﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html ng-app="myApp">
<head >
    <meta name="viewport" content="width=device-width" />
    <title ng-bind-template="{{title}}"></title>
    <script src="~/Scripts/angular.min.js"></script>
    
</head>
<body>
    <div ng-controller="firstController">
        <div>
            <table class="list">
                <tr>
                    <th style="width:auto">序号</th>
                    <th style="width:auto">ID</th>
                    <th style="width:auto">姓名</th>
                    <th style="width:auto">操作</th>
                </tr>
                <tbody>
                    <tr ng-repeat="item in Users">
                        <td>{{ $index + 1 }}</td>
                        <td ng-bind-template="{{item.Id}}"></td>
                        <td ng-bind-template="{{item.Name}}"></td>
                        <td>
                            <a ng-click="doDelete(item.Id)">删除</a>
                            <a class="glyphicon glyphicon-pencil" ng-click="doDelete(item.Id)">编辑</a>
                          
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <script>
        var app = angular.module("myApp", []);
        app.controller("firstController", function ($scope, $http, $rootScope) {
            $rootScope.title = "firstAngularJs.Demo";
            $scope.Users = [
                { Id: 10001, Name: "first张三2" },
                { Id: 10002, Name: "first李四3" },
                { Id: 10003, Name: "first李四4" },
                { Id: 10004, Name: "first李四5" },
                { Id: 10005, Name: "first李四6" },
                { Id: 10001, Name: "first张三2" },
                { Id: 10002, Name: "first李四3" },
                { Id: 10003, Name: "first李四4" }
            ];

           
            $scope.doDelete = function (id) {
                alert(id);
            };
        });

    </script>
</body>
</html>
